import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
import * as echarts from 'echarts'
import { useUserStore } from '@/stores/user'

const app = createApp(App)
const pinia = createPinia()

// 初始化用户状态
const userStore = useUserStore(pinia)
userStore.initialize()

app.config.globalProperties.$echarts = echarts
app.use(ElementPlus)
app.use(pinia)
app.use(router)
app.mount('#app')
